#ifndef QPERSON_H
#define QPERSON_H

#include <QObject>

class QPerson : public QObject
{
    Q_OBJECT
    Q_CLASSINFO("author", "Haozhiyu")
    Q_CLASSINFO("company", "HeimaoYu")
    Q_CLASSINFO("version", "1.0.0")
    Q_PROPERTY(unsigned age READ age WRITE setAge NOTIFY ageChanged)
    Q_PROPERTY(QString name MEMBER m_name)
    Q_PROPERTY(int socre MEMBER m_socre)
private:
    unsigned m_age;
    QString m_name;
    int m_socre = 60;  //默认60分
public:
    explicit QPerson(QString name, QObject *parent = nullptr);
    unsigned age();
    void setAge(unsigned value);
    void incAge();  //长一岁

signals:
    void ageChanged(unsigned value);

};

#endif // QPERSON_H
